//
// CMaterial.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.CRGBA;
import org.ryzom.nel.misc.CRefCount;
import org.ryzom.nel.misc.IStream;

public class CMaterial extends CRefCount {
  private long swigCPtr;

  public CMaterial(long cPtr, boolean cMemoryOwn) {
    super(nel3dJNI.CMaterial_SWIGUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

  public static long getCPtr(CMaterial obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CMaterial(swigCPtr);
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  public CMaterial() {
    this(nel3dJNI.new_CMaterial__SWIG_0(), true);
  }

  public CMaterial(CMaterial mat) {
    this(nel3dJNI.new_CMaterial__SWIG_1(CMaterial.getCPtr(mat), mat), true);
  }

  public CMaterial assign(CMaterial mat) {
    return new CMaterial(nel3dJNI.CMaterial_assign(swigCPtr, this, CMaterial.getCPtr(mat), mat), false);
  }

  public void setShader(CMaterial.TShader val) {
    nel3dJNI.CMaterial_setShader(swigCPtr, this, val.swigValue());
  }

  public CMaterial.TShader getShader() {
    return CMaterial.TShader.swigToEnum(nel3dJNI.CMaterial_getShader(swigCPtr, this));
  }

  public void setTexture(short stage, ITexture ptex) {
    nel3dJNI.CMaterial_setTexture(swigCPtr, this, stage, ITexture.getCPtr(ptex), ptex);
  }

  public ITexture getTexture(short stage) {
    long cPtr = nel3dJNI.CMaterial_getTexture(swigCPtr, this, stage);
    return (cPtr == 0) ? null : new ITexture(cPtr, false);
  }

  public boolean texturePresent(short stage) {
    return nel3dJNI.CMaterial_texturePresent(swigCPtr, this, stage);
  }

  public long getNumUsedTextureStages() {
    return nel3dJNI.CMaterial_getNumUsedTextureStages(swigCPtr, this);
  }

  public void setBlend(boolean active) {
    nel3dJNI.CMaterial_setBlend(swigCPtr, this, active);
  }

  public void setBlendFunc(CMaterial.TBlend src, CMaterial.TBlend dst) {
    nel3dJNI.CMaterial_setBlendFunc(swigCPtr, this, src.swigValue(), dst.swigValue());
  }

  public void setSrcBlend(CMaterial.TBlend val) {
    nel3dJNI.CMaterial_setSrcBlend(swigCPtr, this, val.swigValue());
  }

  public void setDstBlend(CMaterial.TBlend val) {
    nel3dJNI.CMaterial_setDstBlend(swigCPtr, this, val.swigValue());
  }

  public boolean getBlend() {
    return nel3dJNI.CMaterial_getBlend(swigCPtr, this);
  }

  public CMaterial.TBlend getSrcBlend() {
    return CMaterial.TBlend.swigToEnum(nel3dJNI.CMaterial_getSrcBlend(swigCPtr, this));
  }

  public CMaterial.TBlend getDstBlend() {
    return CMaterial.TBlend.swigToEnum(nel3dJNI.CMaterial_getDstBlend(swigCPtr, this));
  }

  public void enableTexAddrMode(boolean enable) {
    nel3dJNI.CMaterial_enableTexAddrMode__SWIG_0(swigCPtr, this, enable);
  }

  public void enableTexAddrMode() {
    nel3dJNI.CMaterial_enableTexAddrMode__SWIG_1(swigCPtr, this);
  }

  public boolean texAddrEnabled() {
    return nel3dJNI.CMaterial_texAddrEnabled(swigCPtr, this);
  }

  public void setTexAddressingMode(short stage, CMaterial.TTexAddressingMode mode) {
    nel3dJNI.CMaterial_setTexAddressingMode(swigCPtr, this, stage, mode.swigValue());
  }

  public CMaterial.TTexAddressingMode getTexAddressingMode(short stage) {
    return CMaterial.TTexAddressingMode.swigToEnum(nel3dJNI.CMaterial_getTexAddressingMode(swigCPtr, this, stage));
  }

  public void setDoubleSided(boolean active) {
    nel3dJNI.CMaterial_setDoubleSided(swigCPtr, this, active);
  }

  public boolean getDoubleSided() {
    return nel3dJNI.CMaterial_getDoubleSided(swigCPtr, this);
  }

  public void setAlphaTest(boolean active) {
    nel3dJNI.CMaterial_setAlphaTest(swigCPtr, this, active);
  }

  public boolean getAlphaTest() {
    return nel3dJNI.CMaterial_getAlphaTest(swigCPtr, this);
  }

  public void setAlphaTestThreshold(float thre) {
    nel3dJNI.CMaterial_setAlphaTestThreshold(swigCPtr, this, thre);
  }

  public float getAlphaTestThreshold() {
    return nel3dJNI.CMaterial_getAlphaTestThreshold(swigCPtr, this);
  }

  public void setZFunc(CMaterial.ZFunc val) {
    nel3dJNI.CMaterial_setZFunc(swigCPtr, this, val.swigValue());
  }

  public void setZWrite(boolean active) {
    nel3dJNI.CMaterial_setZWrite(swigCPtr, this, active);
  }

  public void setZBias(float val) {
    nel3dJNI.CMaterial_setZBias(swigCPtr, this, val);
  }

  public CMaterial.ZFunc getZFunc() {
    return CMaterial.ZFunc.swigToEnum(nel3dJNI.CMaterial_getZFunc(swigCPtr, this));
  }

  public boolean getZWrite() {
    return nel3dJNI.CMaterial_getZWrite(swigCPtr, this);
  }

  public float getZBias() {
    return nel3dJNI.CMaterial_getZBias(swigCPtr, this);
  }

  public void setColor(CRGBA rgba) {
    nel3dJNI.CMaterial_setColor(swigCPtr, this, CRGBA.getCPtr(rgba), rgba);
  }

  public void setLighting(boolean active, CRGBA emissive, CRGBA ambient, CRGBA diffuse, CRGBA specular, float shininess) {
    nel3dJNI.CMaterial_setLighting__SWIG_0(swigCPtr, this, active, CRGBA.getCPtr(emissive), emissive, CRGBA.getCPtr(ambient), ambient, CRGBA.getCPtr(diffuse), diffuse, CRGBA.getCPtr(specular), specular, shininess);
  }

  public void setLighting(boolean active, CRGBA emissive, CRGBA ambient, CRGBA diffuse, CRGBA specular) {
    nel3dJNI.CMaterial_setLighting__SWIG_1(swigCPtr, this, active, CRGBA.getCPtr(emissive), emissive, CRGBA.getCPtr(ambient), ambient, CRGBA.getCPtr(diffuse), diffuse, CRGBA.getCPtr(specular), specular);
  }

  public void setLighting(boolean active, CRGBA emissive, CRGBA ambient, CRGBA diffuse) {
    nel3dJNI.CMaterial_setLighting__SWIG_2(swigCPtr, this, active, CRGBA.getCPtr(emissive), emissive, CRGBA.getCPtr(ambient), ambient, CRGBA.getCPtr(diffuse), diffuse);
  }

  public void setLighting(boolean active, CRGBA emissive, CRGBA ambient) {
    nel3dJNI.CMaterial_setLighting__SWIG_3(swigCPtr, this, active, CRGBA.getCPtr(emissive), emissive, CRGBA.getCPtr(ambient), ambient);
  }

  public void setLighting(boolean active, CRGBA emissive) {
    nel3dJNI.CMaterial_setLighting__SWIG_4(swigCPtr, this, active, CRGBA.getCPtr(emissive), emissive);
  }

  public void setLighting(boolean active) {
    nel3dJNI.CMaterial_setLighting__SWIG_5(swigCPtr, this, active);
  }

  public void setEmissive(CRGBA emissive) {
    nel3dJNI.CMaterial_setEmissive__SWIG_0(swigCPtr, this, CRGBA.getCPtr(emissive), emissive);
  }

  public void setEmissive() {
    nel3dJNI.CMaterial_setEmissive__SWIG_1(swigCPtr, this);
  }

  public void setAmbient(CRGBA ambient) {
    nel3dJNI.CMaterial_setAmbient__SWIG_0(swigCPtr, this, CRGBA.getCPtr(ambient), ambient);
  }

  public void setAmbient() {
    nel3dJNI.CMaterial_setAmbient__SWIG_1(swigCPtr, this);
  }

  public void setDiffuse(CRGBA diffuse) {
    nel3dJNI.CMaterial_setDiffuse__SWIG_0(swigCPtr, this, CRGBA.getCPtr(diffuse), diffuse);
  }

  public void setDiffuse() {
    nel3dJNI.CMaterial_setDiffuse__SWIG_1(swigCPtr, this);
  }

  public void setOpacity(short opa) {
    nel3dJNI.CMaterial_setOpacity(swigCPtr, this, opa);
  }

  public void setSpecular(CRGBA specular) {
    nel3dJNI.CMaterial_setSpecular__SWIG_0(swigCPtr, this, CRGBA.getCPtr(specular), specular);
  }

  public void setSpecular() {
    nel3dJNI.CMaterial_setSpecular__SWIG_1(swigCPtr, this);
  }

  public void setShininess(float shininess) {
    nel3dJNI.CMaterial_setShininess(swigCPtr, this, shininess);
  }

  public void setLightedVertexColor(boolean useLightedVertexColor) {
    nel3dJNI.CMaterial_setLightedVertexColor(swigCPtr, this, useLightedVertexColor);
  }

  public boolean getLightedVertexColor() {
    return nel3dJNI.CMaterial_getLightedVertexColor(swigCPtr, this);
  }

  public boolean isLighted() {
    return nel3dJNI.CMaterial_isLighted(swigCPtr, this);
  }

  public boolean isLightedVertexColor() {
    return nel3dJNI.CMaterial_isLightedVertexColor(swigCPtr, this);
  }

  public CRGBA getColor() {
    return new CRGBA(nel3dJNI.CMaterial_getColor(swigCPtr, this), true);
  }

  public CRGBA getEmissive() {
    return new CRGBA(nel3dJNI.CMaterial_getEmissive(swigCPtr, this), true);
  }

  public CRGBA getAmbient() {
    return new CRGBA(nel3dJNI.CMaterial_getAmbient(swigCPtr, this), true);
  }

  public CRGBA getDiffuse() {
    return new CRGBA(nel3dJNI.CMaterial_getDiffuse(swigCPtr, this), true);
  }

  public short getOpacity() {
    return nel3dJNI.CMaterial_getOpacity(swigCPtr, this);
  }

  public CRGBA getSpecular() {
    return new CRGBA(nel3dJNI.CMaterial_getSpecular(swigCPtr, this), true);
  }

  public float getShininess() {
    return nel3dJNI.CMaterial_getShininess(swigCPtr, this);
  }

  public void texEnvOpRGB(long stage, CMaterial.TTexOperator ope) {
    nel3dJNI.CMaterial_texEnvOpRGB(swigCPtr, this, stage, ope.swigValue());
  }

  public void texEnvArg0RGB(long stage, CMaterial.TTexSource src, CMaterial.TTexOperand oper) {
    nel3dJNI.CMaterial_texEnvArg0RGB(swigCPtr, this, stage, src.swigValue(), oper.swigValue());
  }

  public void texEnvArg1RGB(long stage, CMaterial.TTexSource src, CMaterial.TTexOperand oper) {
    nel3dJNI.CMaterial_texEnvArg1RGB(swigCPtr, this, stage, src.swigValue(), oper.swigValue());
  }

  public void texEnvArg2RGB(long stage, CMaterial.TTexSource src, CMaterial.TTexOperand oper) {
    nel3dJNI.CMaterial_texEnvArg2RGB(swigCPtr, this, stage, src.swigValue(), oper.swigValue());
  }

  public void texEnvOpAlpha(long stage, CMaterial.TTexOperator ope) {
    nel3dJNI.CMaterial_texEnvOpAlpha(swigCPtr, this, stage, ope.swigValue());
  }

  public void texEnvArg0Alpha(long stage, CMaterial.TTexSource src, CMaterial.TTexOperand oper) {
    nel3dJNI.CMaterial_texEnvArg0Alpha(swigCPtr, this, stage, src.swigValue(), oper.swigValue());
  }

  public void texEnvArg1Alpha(long stage, CMaterial.TTexSource src, CMaterial.TTexOperand oper) {
    nel3dJNI.CMaterial_texEnvArg1Alpha(swigCPtr, this, stage, src.swigValue(), oper.swigValue());
  }

  public void texEnvArg2Alpha(long stage, CMaterial.TTexSource src, CMaterial.TTexOperand oper) {
    nel3dJNI.CMaterial_texEnvArg2Alpha(swigCPtr, this, stage, src.swigValue(), oper.swigValue());
  }

  public void texConstantColor(long stage, CRGBA color) {
    nel3dJNI.CMaterial_texConstantColor(swigCPtr, this, stage, CRGBA.getCPtr(color), color);
  }

  public long getTexEnvMode(long stage) {
    return nel3dJNI.CMaterial_getTexEnvMode(swigCPtr, this, stage);
  }

  public void setTexEnvMode(long stage, long packed) {
    nel3dJNI.CMaterial_setTexEnvMode(swigCPtr, this, stage, packed);
  }

  public CRGBA getTexConstantColor(long stage) {
    return new CRGBA(nel3dJNI.CMaterial_getTexConstantColor(swigCPtr, this, stage), true);
  }

  public CMaterial.TTexOperator getTexEnvOpRGB(long stage) {
    return CMaterial.TTexOperator.swigToEnum(nel3dJNI.CMaterial_getTexEnvOpRGB(swigCPtr, this, stage));
  }

  public CMaterial.TTexOperator getTexEnvOpAlpha(long stage) {
    return CMaterial.TTexOperator.swigToEnum(nel3dJNI.CMaterial_getTexEnvOpAlpha(swigCPtr, this, stage));
  }

  public void setTexCoordGen(long stage, boolean generate) {
    nel3dJNI.CMaterial_setTexCoordGen(swigCPtr, this, stage, generate);
  }

  public boolean getTexCoordGen(long stage) {
    return nel3dJNI.CMaterial_getTexCoordGen(swigCPtr, this, stage);
  }

  public void setTexCoordGenMode(long stage, CMaterial.TTexCoordGenMode mode) {
    nel3dJNI.CMaterial_setTexCoordGenMode(swigCPtr, this, stage, mode.swigValue());
  }

  public CMaterial.TTexCoordGenMode getTexCoordGenMode(long stage) {
    return CMaterial.TTexCoordGenMode.swigToEnum(nel3dJNI.CMaterial_getTexCoordGenMode(swigCPtr, this, stage));
  }

  public void enableUserTexMat(long stage, boolean enabled) {
    nel3dJNI.CMaterial_enableUserTexMat__SWIG_0(swigCPtr, this, stage, enabled);
  }

  public void enableUserTexMat(long stage) {
    nel3dJNI.CMaterial_enableUserTexMat__SWIG_1(swigCPtr, this, stage);
  }

  public boolean isUserTexMatEnabled(long stage) {
    return nel3dJNI.CMaterial_isUserTexMatEnabled(swigCPtr, this, stage);
  }

  public void setUserTexMat(long stage, SWIGTYPE_p_NLMISC__CMatrix m) {
    nel3dJNI.CMaterial_setUserTexMat(swigCPtr, this, stage, SWIGTYPE_p_NLMISC__CMatrix.getCPtr(m));
  }

  public SWIGTYPE_p_NLMISC__CMatrix getUserTexMat(long stage) {
    return new SWIGTYPE_p_NLMISC__CMatrix(nel3dJNI.CMaterial_getUserTexMat(swigCPtr, this, stage), false);
  }

  public void decompUserTexMat(long stage, SWIGTYPE_p_float uTrans, SWIGTYPE_p_float vTrans, SWIGTYPE_p_float wRot, SWIGTYPE_p_float uScale, SWIGTYPE_p_float vScale) {
    nel3dJNI.CMaterial_decompUserTexMat(swigCPtr, this, stage, SWIGTYPE_p_float.getCPtr(uTrans), SWIGTYPE_p_float.getCPtr(vTrans), SWIGTYPE_p_float.getCPtr(wRot), SWIGTYPE_p_float.getCPtr(uScale), SWIGTYPE_p_float.getCPtr(vScale));
  }

  public void setUserColor(CRGBA userColor) {
    nel3dJNI.CMaterial_setUserColor(swigCPtr, this, CRGBA.getCPtr(userColor), userColor);
  }

  public CRGBA getUserColor() {
    return new CRGBA(nel3dJNI.CMaterial_getUserColor(swigCPtr, this), true);
  }

  public void setLightMap(long lmapId, ITexture lmap) {
    nel3dJNI.CMaterial_setLightMap(swigCPtr, this, lmapId, ITexture.getCPtr(lmap), lmap);
  }

  public ITexture getLightMap(long lmapId) {
    long cPtr = nel3dJNI.CMaterial_getLightMap(swigCPtr, this, lmapId);
    return (cPtr == 0) ? null : new ITexture(cPtr, false);
  }

  public void setLightMapFactor(long lmapId, CRGBA factor) {
    nel3dJNI.CMaterial_setLightMapFactor(swigCPtr, this, lmapId, CRGBA.getCPtr(factor), factor);
  }

  public void setLightMapMulx2(boolean val) {
    nel3dJNI.CMaterial_setLightMapMulx2(swigCPtr, this, val);
  }

  public void setLMCColors(long lmapId, CRGBA ambColor, CRGBA diffColor) {
    nel3dJNI.CMaterial_setLMCColors(swigCPtr, this, lmapId, CRGBA.getCPtr(ambColor), ambColor, CRGBA.getCPtr(diffColor), diffColor);
  }

  public void initUnlit() {
    nel3dJNI.CMaterial_initUnlit(swigCPtr, this);
  }

  public void initLighted() {
    nel3dJNI.CMaterial_initLighted(swigCPtr, this);
  }

  public boolean getStainedGlassWindow() {
    return nel3dJNI.CMaterial_getStainedGlassWindow(swigCPtr, this);
  }

  public void setStainedGlassWindow(boolean val) {
    nel3dJNI.CMaterial_setStainedGlassWindow(swigCPtr, this, val);
  }

  public void flushTextures(IDriver driver, long selectedTexture) {
    nel3dJNI.CMaterial_flushTextures(swigCPtr, this, IDriver.getCPtr(driver), driver, selectedTexture);
  }

  public void serial(IStream f) {
    nel3dJNI.CMaterial_serial(swigCPtr, this, IStream.getCPtr(f), f);
  }

  public void selectTextureSet(long index) {
    nel3dJNI.CMaterial_selectTextureSet(swigCPtr, this, index);
  }

  public boolean isSupportedByDriver(IDriver drv, boolean forceBaseCaps) {
    return nel3dJNI.CMaterial_isSupportedByDriver(swigCPtr, this, IDriver.getCPtr(drv), drv, forceBaseCaps);
  }

  public void set_Textures(SWIGTYPE_p_CSmartPtrT_NL3D__ITexture_t value) {
    nel3dJNI.CMaterial__Textures_set(swigCPtr, this, SWIGTYPE_p_CSmartPtrT_NL3D__ITexture_t.getCPtr(value));
  }

  public SWIGTYPE_p_CSmartPtrT_NL3D__ITexture_t get_Textures() {
    long cPtr = nel3dJNI.CMaterial__Textures_get(swigCPtr, this);
    return (cPtr == 0) ? null : new SWIGTYPE_p_CSmartPtrT_NL3D__ITexture_t(cPtr, false);
  }

  public void set_TexAddrMode(SWIGTYPE_p_unsigned_char value) {
    nel3dJNI.CMaterial__TexAddrMode_set(swigCPtr, this, SWIGTYPE_p_unsigned_char.getCPtr(value));
  }

  public SWIGTYPE_p_unsigned_char get_TexAddrMode() {
    long cPtr = nel3dJNI.CMaterial__TexAddrMode_get(swigCPtr, this);
    return (cPtr == 0) ? null : new SWIGTYPE_p_unsigned_char(cPtr, false);
  }

  public void set_TexEnvs(SWIGTYPE_p_NL3D__CMaterial__CTexEnv value) {
    nel3dJNI.CMaterial__TexEnvs_set(swigCPtr, this, SWIGTYPE_p_NL3D__CMaterial__CTexEnv.getCPtr(value));
  }

  public SWIGTYPE_p_NL3D__CMaterial__CTexEnv get_TexEnvs() {
    long cPtr = nel3dJNI.CMaterial__TexEnvs_get(swigCPtr, this);
    return (cPtr == 0) ? null : new SWIGTYPE_p_NL3D__CMaterial__CTexEnv(cPtr, false);
  }

  public void set_MatDrvInfo(SWIGTYPE_p_CRefPtrT_NL3D__IMaterialDrvInfos_t value) {
    nel3dJNI.CMaterial__MatDrvInfo_set(swigCPtr, this, SWIGTYPE_p_CRefPtrT_NL3D__IMaterialDrvInfos_t.getCPtr(value));
  }

  public SWIGTYPE_p_CRefPtrT_NL3D__IMaterialDrvInfos_t get_MatDrvInfo() {
    long cPtr = nel3dJNI.CMaterial__MatDrvInfo_get(swigCPtr, this);
    return (cPtr == 0) ? null : new SWIGTYPE_p_CRefPtrT_NL3D__IMaterialDrvInfos_t(cPtr, false);
  }

  public void set_LightMaps(SWIGTYPE_p_std__vectorT_NL3D__CLightMap_t value) {
    nel3dJNI.CMaterial__LightMaps_set(swigCPtr, this, SWIGTYPE_p_std__vectorT_NL3D__CLightMap_t.getCPtr(value));
  }

  public SWIGTYPE_p_std__vectorT_NL3D__CLightMap_t get_LightMaps() {
    long cPtr = nel3dJNI.CMaterial__LightMaps_get(swigCPtr, this);
    return (cPtr == 0) ? null : new SWIGTYPE_p_std__vectorT_NL3D__CLightMap_t(cPtr, false);
  }

  public void set_LightMapsMulx2(boolean value) {
    nel3dJNI.CMaterial__LightMapsMulx2_set(swigCPtr, this, value);
  }

  public boolean get_LightMapsMulx2() {
    return nel3dJNI.CMaterial__LightMapsMulx2_get(swigCPtr, this);
  }

  public long getFlags() {
    return nel3dJNI.CMaterial_getFlags(swigCPtr, this);
  }

  public long getTouched() {
    return nel3dJNI.CMaterial_getTouched(swigCPtr, this);
  }

  public void clearTouched(long flag) {
    nel3dJNI.CMaterial_clearTouched(swigCPtr, this, flag);
  }

  public final static class ZFunc {
    public final static ZFunc always = new ZFunc("always", nel3dJNI.CMaterial_always_get());
    public final static ZFunc never = new ZFunc("never");
    public final static ZFunc equal = new ZFunc("equal");
    public final static ZFunc notequal = new ZFunc("notequal");
    public final static ZFunc less = new ZFunc("less");
    public final static ZFunc lessequal = new ZFunc("lessequal");
    public final static ZFunc greater = new ZFunc("greater");
    public final static ZFunc greaterequal = new ZFunc("greaterequal");
    public final static ZFunc zfuncCount = new ZFunc("zfuncCount");

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static ZFunc swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + ZFunc.class + " with value " + swigValue);
    }

    private ZFunc(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private ZFunc(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private ZFunc(String swigName, ZFunc swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static ZFunc[] swigValues = { always, never, equal, notequal, less, lessequal, greater, greaterequal, zfuncCount };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

  public final static class TBlend {
    public final static TBlend one = new TBlend("one", nel3dJNI.CMaterial_one_get());
    public final static TBlend zero = new TBlend("zero");
    public final static TBlend srcalpha = new TBlend("srcalpha");
    public final static TBlend invsrcalpha = new TBlend("invsrcalpha");
    public final static TBlend srccolor = new TBlend("srccolor");
    public final static TBlend invsrccolor = new TBlend("invsrccolor");
    public final static TBlend blendConstantColor = new TBlend("blendConstantColor");
    public final static TBlend blendConstantInvColor = new TBlend("blendConstantInvColor");
    public final static TBlend blendConstantAlpha = new TBlend("blendConstantAlpha");
    public final static TBlend blendConstantInvAlpha = new TBlend("blendConstantInvAlpha");
    public final static TBlend blendCount = new TBlend("blendCount");

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static TBlend swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + TBlend.class + " with value " + swigValue);
    }

    private TBlend(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private TBlend(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private TBlend(String swigName, TBlend swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static TBlend[] swigValues = { one, zero, srcalpha, invsrcalpha, srccolor, invsrccolor, blendConstantColor, blendConstantInvColor, blendConstantAlpha, blendConstantInvAlpha, blendCount };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

  public final static class TShader {
    public final static TShader Normal = new TShader("Normal", nel3dJNI.CMaterial_Normal_get());
    public final static TShader Bump = new TShader("Bump");
    public final static TShader UserColor = new TShader("UserColor");
    public final static TShader LightMap = new TShader("LightMap");
    public final static TShader Specular = new TShader("Specular");
    public final static TShader Caustics = new TShader("Caustics");
    public final static TShader PerPixelLighting = new TShader("PerPixelLighting");
    public final static TShader PerPixelLightingNoSpec = new TShader("PerPixelLightingNoSpec");
    public final static TShader Cloud = new TShader("Cloud");
    public final static TShader Water = new TShader("Water");
    public final static TShader shaderCount = new TShader("shaderCount");

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static TShader swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + TShader.class + " with value " + swigValue);
    }

    private TShader(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private TShader(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private TShader(String swigName, TShader swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static TShader[] swigValues = { Normal, Bump, UserColor, LightMap, Specular, Caustics, PerPixelLighting, PerPixelLightingNoSpec, Cloud, Water, shaderCount };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

  public final static class TTexOperator {
    public final static TTexOperator Replace = new TTexOperator("Replace", nel3dJNI.CMaterial_Replace_get());
    public final static TTexOperator Modulate = new TTexOperator("Modulate");
    public final static TTexOperator Add = new TTexOperator("Add");
    public final static TTexOperator AddSigned = new TTexOperator("AddSigned");
    public final static TTexOperator InterpolateTexture = new TTexOperator("InterpolateTexture");
    public final static TTexOperator InterpolatePrevious = new TTexOperator("InterpolatePrevious");
    public final static TTexOperator InterpolateDiffuse = new TTexOperator("InterpolateDiffuse");
    public final static TTexOperator InterpolateConstant = new TTexOperator("InterpolateConstant");
    public final static TTexOperator EMBM = new TTexOperator("EMBM");
    public final static TTexOperator Mad = new TTexOperator("Mad");
    public final static TTexOperator TexOperatorCount = new TTexOperator("TexOperatorCount");

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static TTexOperator swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + TTexOperator.class + " with value " + swigValue);
    }

    private TTexOperator(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private TTexOperator(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private TTexOperator(String swigName, TTexOperator swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static TTexOperator[] swigValues = { Replace, Modulate, Add, AddSigned, InterpolateTexture, InterpolatePrevious, InterpolateDiffuse, InterpolateConstant, EMBM, Mad, TexOperatorCount };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

  public final static class TTexSource {
    public final static TTexSource Texture = new TTexSource("Texture", nel3dJNI.CMaterial_Texture_get());
    public final static TTexSource Previous = new TTexSource("Previous");
    public final static TTexSource Diffuse = new TTexSource("Diffuse");
    public final static TTexSource Constant = new TTexSource("Constant");
    public final static TTexSource TexSourceCount = new TTexSource("TexSourceCount");

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static TTexSource swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + TTexSource.class + " with value " + swigValue);
    }

    private TTexSource(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private TTexSource(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private TTexSource(String swigName, TTexSource swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static TTexSource[] swigValues = { Texture, Previous, Diffuse, Constant, TexSourceCount };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

  public final static class TTexOperand {
    public final static TTexOperand SrcColor = new TTexOperand("SrcColor", nel3dJNI.CMaterial_SrcColor_get());
    public final static TTexOperand InvSrcColor = new TTexOperand("InvSrcColor");
    public final static TTexOperand SrcAlpha = new TTexOperand("SrcAlpha");
    public final static TTexOperand InvSrcAlpha = new TTexOperand("InvSrcAlpha");
    public final static TTexOperand TexOperandCount = new TTexOperand("TexOperandCount");

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static TTexOperand swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + TTexOperand.class + " with value " + swigValue);
    }

    private TTexOperand(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private TTexOperand(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private TTexOperand(String swigName, TTexOperand swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static TTexOperand[] swigValues = { SrcColor, InvSrcColor, SrcAlpha, InvSrcAlpha, TexOperandCount };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

  public final static class TTexAddressingMode {
    public final static TTexAddressingMode TextureOff = new TTexAddressingMode("TextureOff", nel3dJNI.CMaterial_TextureOff_get());
    public final static TTexAddressingMode FetchTexture = new TTexAddressingMode("FetchTexture");
    public final static TTexAddressingMode PassThrough = new TTexAddressingMode("PassThrough");
    public final static TTexAddressingMode CullFragment = new TTexAddressingMode("CullFragment");
    public final static TTexAddressingMode OffsetTexture = new TTexAddressingMode("OffsetTexture");
    public final static TTexAddressingMode OffsetTextureScale = new TTexAddressingMode("OffsetTextureScale");
    public final static TTexAddressingMode DependentARTexture = new TTexAddressingMode("DependentARTexture");
    public final static TTexAddressingMode DependentGBTexture = new TTexAddressingMode("DependentGBTexture");
    public final static TTexAddressingMode DP3 = new TTexAddressingMode("DP3");
    public final static TTexAddressingMode DP3Texture2D = new TTexAddressingMode("DP3Texture2D");
    public final static TTexAddressingMode DP3CubeMap = new TTexAddressingMode("DP3CubeMap");
    public final static TTexAddressingMode DP3ReflectCubeMap = new TTexAddressingMode("DP3ReflectCubeMap");
    public final static TTexAddressingMode DP3ConstEyeReflectCubeMap = new TTexAddressingMode("DP3ConstEyeReflectCubeMap");
    public final static TTexAddressingMode DP3DiffuseCubeMap = new TTexAddressingMode("DP3DiffuseCubeMap");
    public final static TTexAddressingMode DP3DepthReplace = new TTexAddressingMode("DP3DepthReplace");
    public final static TTexAddressingMode TexAddrCount = new TTexAddressingMode("TexAddrCount");

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static TTexAddressingMode swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + TTexAddressingMode.class + " with value " + swigValue);
    }

    private TTexAddressingMode(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private TTexAddressingMode(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private TTexAddressingMode(String swigName, TTexAddressingMode swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static TTexAddressingMode[] swigValues = { TextureOff, FetchTexture, PassThrough, CullFragment, OffsetTexture, OffsetTextureScale, DependentARTexture, DependentGBTexture, DP3, DP3Texture2D, DP3CubeMap, DP3ReflectCubeMap, DP3ConstEyeReflectCubeMap, DP3DiffuseCubeMap, DP3DepthReplace, TexAddrCount };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

  public final static class TTexCoordGenMode {
    public final static TTexCoordGenMode TexCoordGenReflect = new TTexCoordGenMode("TexCoordGenReflect", nel3dJNI.CMaterial_TexCoordGenReflect_get());
    public final static TTexCoordGenMode TexCoordGenObjectSpace = new TTexCoordGenMode("TexCoordGenObjectSpace");
    public final static TTexCoordGenMode TexCoordGenEyeSpace = new TTexCoordGenMode("TexCoordGenEyeSpace");
    public final static TTexCoordGenMode numTexCoordGenMode = new TTexCoordGenMode("numTexCoordGenMode");

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static TTexCoordGenMode swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + TTexCoordGenMode.class + " with value " + swigValue);
    }

    private TTexCoordGenMode(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private TTexCoordGenMode(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private TTexCoordGenMode(String swigName, TTexCoordGenMode swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static TTexCoordGenMode[] swigValues = { TexCoordGenReflect, TexCoordGenObjectSpace, TexCoordGenEyeSpace, numTexCoordGenMode };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

}
